{subtemplate common/header}

<script type="text/javascript">var fid = parseInt('$_G[fid]'), tid = parseInt('$_G[tid]');</script>
<!--{if $_G['forum']['ismoderator']}-->
	<script type="text/javascript" src="{$_G['setting']['jspath']}forum_moderate.js?{VERHASH}"></script>
<!--{/if}-->

<script type="text/javascript" src="{$_G['setting']['jspath']}forum_viewthread.js?{VERHASH}"></script>
<script type="text/javascript">zoomstatus = parseInt($_G['setting']['zoomstatus']);var imagemaxwidth = '{IMAGEMAXWIDTH}';var aimgcount = new Array();</script>

<div id="pt" class="wp">
	<a href="index.php" id="fjump"{if $_G['setting']['forumjump'] == 1} class="dropmenu" onmouseover="showMenu({'ctrlid':this.id})"{/if} class="nvhm">$_G[setting][bbname]</a>$navigation &rsaquo; {lang user_threads}
</div>

{hook/viewthread_top}
{ad/text/wp a_t}

<style id="diy_style" type="text/css"></style>
<div class="wp">
	<!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]-->
</div>

<!--{if $_G['forum']['ismoderator']}-->
	<ul class="p_pop inlinelist" id="modopt_menu" style="width: 203px; w\idth: 193px; display: none">{eval $modopt=0;}
	<!--{if $_G['forum_thread']['digest'] >= 0}-->
		<!--{if $_G['group']['allowdelpost']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(3, 'delete')">{lang delete}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowbumpthread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(3, 'down')">{lang up_down}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowstickthread'] && ($_G['forum_thread']['displayorder'] <= 3 || $_G['adminid'] == 1) && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(1, 'stick')">{lang thread_stick}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowhighlightthread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(1, 'highlight')">{lang thread_highlight}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowdigestthread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(1, 'digest')">{lang digestposts}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowrecommendthread'] && !empty($_G['forum']['modrecommend']['open']) && $_G['forum']['modrecommend']['sort'] != 1 && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(1, 'recommend')">{lang order_recommends}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowstampthread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('stamp')">{lang identify}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowclosethread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(4)">{lang switch}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowmovethread'] && !$_G['forum_thread']['is_archived'] && $_G['forum']['status'] != 3}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(2, 'move')">{lang thread_moved}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowedittypethread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modthreads(2, 'type')">{lang types}</a></li><!--{/if}-->
		<!--{if !$_G['forum_thread']['special'] && !$_G['forum_thread']['is_archived']}-->
			<!--{if $_G['group']['allowcopythread'] && $_G['forum']['status'] != 3}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('copy')">{lang copy}</a></li><!--{/if}-->
			<!--{if $_G['group']['allowmergethread'] && $_G['forum']['status'] != 3}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('merge')">{lang admin_merge}</a></li><!--{/if}-->
			<!--{if $_G['group']['allowrefund'] && $_G['forum_thread']['price'] > 0}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('refund')">{lang modcp_restore}</a></li><!--{/if}-->
		<!--{/if}-->
		<!--{if $_G['group']['allowsplitthread'] && !$_G['forum_thread']['is_archived'] && $_G['forum']['status'] != 3}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('split')">{lang cut_up}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowrepairthread'] && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('repair')">{lang repair}</a></li><!--{/if}-->
		<!--{if $_G['forum_thread']['is_archived'] && $_G['adminid'] == 1}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('restore', '', 'archiveid={$_G[forum_thread][archiveid]}')">{lang cancel_archive}</a></li><!--{/if}-->
	<!--{/if}-->
	<!--{if $_G['group']['allowremovereward'] && $_G['forum_thread']['special'] == 3 && !$_G['forum_thread']['is_archived']}-->{eval $modopt++}<li><a href="javascript:;" onclick="modaction('removereward')">{lang remove_reward}</a></li><!--{/if}-->
	
	<!--{if $_G['forum']['status'] == 3 && in_array($_G['adminid'], array('1','2')) && $_G['forum_thread']['closed'] < 1}-->
		<li><a href="javascript:;" onclick="modthreads(2, 'recommend_group');return false;">{lang topicadmin_recommend_forum}</a></li>
	<!--{/if}-->
	</ul>
	<!--{if $_G['group']['allowwarnpost'] || $_G['group']['allowbanpost'] || $_G['group']['allowdelpost'] || $_G['group']['allowstickreply']}-->
		<div id="mdly" style="display:none;">
			<h6><span>{lang admin_select}</span><strong id="mdct"></strong><span>{lang piece}: </span></h6>
			<!--{if $_G['group']['allowwarnpost']}-->
				<a href="javascript:;" onclick="modaction('warn')">{lang warn}</a>
			<!--{/if}-->
			<!--{if $_G['group']['allowbanpost']}-->
				<a href="javascript:;" onclick="modaction('banpost')">{lang admin_banpost}</a>
			<!--{/if}-->
			<!--{if $_G['group']['allowdelpost']}-->
				<a href="javascript:;" onclick="modaction('delpost')">{lang delete}</a>
			<!--{/if}-->
			<!--{if $_G['group']['allowstickreply']}-->
				<a href="javascript:;" onclick="modaction('stickreply')">{lang thread_stick}</a>
			<!--{/if}-->
		</div>
	<!--{/if}-->
<!--{/if}-->

<div id="ct" class="wp cl">
	<div class="ch">
		<label class="wx"><!--{if $_G['basescript'] == 'forum' && $_G['forum']['status'] != 3}--><a href="$_G[setting][navs][2][filename]">$_G[setting][navs][2][navname]</a><!--{elseif $_G['basescript'] == 'group' || $_G['forum']['status'] == 3}--><a href="$_G[setting][navs][3][filename]">$_G[setting][navs][3][navname]</a><!--{/if}--></label>
		{hook/viewthread_header}
	</div>
	<div class="pl plt">
		<table cellspacing="0" cellpadding="0" class="pl">
			<tr class="pnv">
				<td class="pls">
					<div class="tns">
						<table cellpadding="4" cellspacing="0" border="0">
							<tr>
								<th><p>$_G[forum_thread][views]</p>{lang show}</th><td><p>$_G[forum_thread][replies]</p>{lang reply}</td>
							</tr>
						</table>
					</div>
				</td>
				<td class="plc pnh">
					<div class="pgt">$multipage</div>
					<!--{if $_G['page'] > 1}--><div class="pg"><a href="forum.php?mod=viewthread&tid=$_G[tid]&extra=$_G[gp_extra]">1...</a></div><!--{/if}-->
					<span class="y pgb"{if $_G['setting']['visitedforums']} id="visitedforums" onmouseover="$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id})"{/if}><a href="$upnavlink">{lang return_forumdisplay}</a></span>
					<!--{if $_G['forum']['threadsorts'] && $_G['forum']['threadsorts']['templatelist']}-->
						<!--{loop $_G['forum']['threadsorts']['types'] $id $name}-->
							<button id="newspecial" class="pn pnc" onclick="location.href='forum.php?mod=post&action=newthread&amp;fid=$_G[fid]&amp;extra=$extra&amp;sortid=$id'"><strong>{lang i_want}$name</strong></button>
						<!--{/loop}-->
					<!--{else}-->
						<!--{if !$_G['forum_thread']['is_archived']}--><button id="newspecial" class="pn pnc" prompt="post_newthread" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"{if !$_G['forum']['allowspecialonly']} onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=$_G[fid]')"{else} onclick="location.href='forum.php?mod=post&action=newthread&fid=$_G[fid]'"{/if}><strong>{lang send_posts}</strong></button><!--{/if}-->
					<!--{/if}-->
					<!--{if $allowpostreply && !$_G['forum_thread']['archiveid']}-->
						<button id="post_reply" class="pn" prompt="post_reply" onclick="showWindow('reply', 'forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]')"><strong>{lang reply}</strong></button>
					<!--{/if}-->
					<!--{if $_G['forum']['ismoderator'] && $modopt}-->
						<button id="modopt" onclick="$('modopt').id = 'modopttmp';this.id = 'modopt';showMenu({'ctrlid':this.id})" class="pn"><em>{lang admin_modoptions}</em></button>
					<!--{/if}-->
				</td>
			</tr>
		</table>
	</div>

<!--{if $_G['group']['allowpost'] && ($_G['group']['allowposttrade'] || $_G['group']['allowpostpoll'] || $_G['group']['allowpostreward'] || $_G['group']['allowpostactivity'] || $_G['group']['allowpostdebate'] || $_G['setting']['threadplugins'] || $_G['forum']['threadsorts'])}-->
	<ul class="p_pop" id="newspecial_menu" style="display: none">
		<!--{if !$_G['forum']['allowspecialonly']}--><li><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]">{lang post_newthread}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowpostpoll']}--><li class="poll"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=1">{lang post_newthreadpoll}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowpostreward']}--><li class="reward"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=3">{lang post_newthreadreward}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowpostdebate']}--><li class="debate"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=5">{lang post_newthreaddebate}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowpostactivity']}--><li class="activity"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=4">{lang post_newthreadactivity}</a></li><!--{/if}-->
		<!--{if $_G['group']['allowposttrade']}--><li class="trade"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=2">{lang post_newthreadtrade}</a></li><!--{/if}-->
		<!--{if $_G['setting']['threadplugins']}-->
			<!--{loop $_G['forum']['threadplugin'] $tpid}-->
				<!--{if array_key_exists($tpid, $_G['setting']['threadplugins']) && @in_array($tpid, $_G['group']['allowthreadplugin'])}-->
					<li class="popupmenu_option"{if $_G['setting']['threadplugins'][$tpid][icon]} style="background-image:url($_G['setting']['threadplugins'][$tpid][icon])"{/if}><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&specialextra=$tpid">{$_G['setting']['threadplugins'][$tpid][name]}</a></li>
				<!--{/if}-->
			<!--{/loop}-->
		<!--{/if}-->
		<!--{if $_G['forum']['threadsorts'] && !$_G['forum']['allowspecialonly']}-->
			<!--{loop $_G['forum']['threadsorts']['types'] $id $threadsorts}-->
				<!--{if $_G['forum']['threadsorts']['show'][$id]}-->
					<li class="popupmenu_option"><a href="forum.php?mod=post&action=newthread&amp;fid=$_G[fid]&amp;extra=$_G[gp_extra]&amp;sortid=$id">$threadsorts</a></li>
				<!--{/if}-->
			<!--{/loop}-->
		<!--{/if}-->
	</ul>
<!--{/if}-->

<div id="postlist" class="pl">
	<!--{if $_G['page'] > 1}-->
		<table>
			<tr>
				<td class="pls">
					<div id="tath" class="cl">
						<!--{if $_G[forum_thread][authorid] && $_G[forum_thread][author]}-->
							<a href="home.php?mod=space&uid=$_G[forum_thread][authorid]"><!--{avatar($_G[forum_thread][authorid],small)}--></a>
							{lang thread_author}: <a href="home.php?mod=space&uid=$_G[forum_thread][authorid]">$_G[forum_thread][author]</a>
						<!--{else}-->
							{lang thread_author}:
							<!--{if $_G['forum']['ismoderator']}-->
								<a href="home.php?mod=space&uid=$_G[forum_thread][authorid]">{lang anonymous}</a>
							<!--{else}-->
								{lang anonymous}
							<!--{/if}-->
						<!--{/if}-->
					</div>
				</td>
				<td class="plc">
					<div class="ph ptn pbn"><h1 class="wx"><a href="forum.php?mod=viewthread&tid=$_G[tid]&extra=$_G[gp_extra]">$_G[forum_thread][subject]</a></h1></div>
				</td>
			</tr>
			<tr class="ad">
				<td class="pls"></td>
				<td class="plc"></td>
			</tr>
		</table>
	<!--{/if}-->
{eval $postcount = 0;}
<!--{loop $postlist $post}-->
	<div id="post_$post[pid]">
		{subtemplate forum/viewthread_node}
	</div>
{eval $postcount++;}
<!--{/loop}-->
</div>

<!--{if $_G['setting']['magicstatus']}-->
	<ul id="mgc_thread_menu" class="p_pop mgcmn" style="display: none;">
		<!--{if !empty($_G['setting']['magics']['bump'])}--><li><a href="home.php?mod=magic&mid=bump&idtype=tid&id=$_G[tid]" id="a_bump" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/bump.small.gif" />$_G['setting']['magics']['bump']</a></li><!--{/if}-->
		<!--{if !empty($_G['setting']['magics']['stick'])}--><li><a href="home.php?mod=magic&mid=stick&idtype=tid&id=$_G[tid]" id="a_stick" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/stick.small.gif" />$_G['setting']['magics']['stick']</a></li><!--{/if}-->
		<!--{if !empty($_G['setting']['magics']['close'])}--><li><a href="home.php?mod=magic&mid=close&idtype=tid&id=$_G[tid]" id="a_stick" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/close.small.gif" />$_G['setting']['magics']['close']</a></li><!--{/if}-->
		<!--{if !empty($_G['setting']['magics']['open'])}--><li><a href="home.php?mod=magic&mid=open&idtype=tid&id=$_G[tid]" id="a_stick" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/open.small.gif" />$_G['setting']['magics']['open']</a></li><!--{/if}-->
		<!--{if !empty($_G['setting']['magics']['highlight'])}--><li><a href="home.php?mod=magic&mid=highlight&idtype=tid&id=$_G[tid]" id="a_stick" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/highlight.small.gif" />$_G['setting']['magics']['highlight']</a></li><!--{/if}-->
		<!--{if !empty($_G['setting']['magics']['sofa'])}--><li><a href="home.php?mod=magic&mid=sofa&idtype=tid&id=$_G[tid]" id="a_stick" onclick="showWindow(this.id, this.href)"><img src="{STATICURL}image/magic/sofa.small.gif" />$_G['setting']['magics']['sofa']</a></li><!--{/if}-->
		{hook/viewthread_magic_thread}
	</ul>
	<script type="text/javascript">checkmgcmn('thread')</script>
<!--{/if}-->

<div id="postlistreply" class="pl"><div id="post_new" class="viewthread_table" style="display: none"></div></div>

<form method="post" autocomplete="off" name="modactions" id="modactions">
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="optgroup" />
<input type="hidden" name="operation" />
<input type="hidden" name="listextra" value="$_G[gp_extra]" />
</form>

$_G['forum_tagscript']

<div class="pl">
	<table cellspacing="0" cellpadding="0">
		<tr class="pnv">
			<!--{if !$_G['forum_thread']['archiveid']}-->
				<td class="pls tnv">
					<a href="forum.php?mod=redirect&goto=nextoldset&tid=$_G[tid]">&lsaquo; {lang last_thread}</a><span class="pipe">|</span><a href="forum.php?mod=redirect&goto=nextnewset&tid=$_G[tid]">{lang next_thread} &rsaquo;</a>
				</td>
			<!--{/if}-->
			<td class="plc pnh">
				$multipage
				<span class="pgb y"{if $_G['setting']['visitedforums']} id="visitedforums" onmouseover="$('visitedforums').id = 'visitedforumstmp';this.id = 'visitedforums';showMenu({'ctrlid':this.id})"{/if}><a href="$upnavlink">{lang return_forumdisplay}</a></span>
				<!--{if !$_G['setting']['fastpost'] && !$_G['forum_thread']['archiveid']}-->
				<button id="newspecialtmp" class="pn pnc" prompt="post_newthread" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})"{if !$_G['forum']['allowspecialonly']} onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=$_G[fid]')"{else} onclick="location.href='forum.php?mod=post&action=newthread&fid=$_G[fid]'"{/if}><strong>{lang send_posts}</strong></button>
				<!--{if $allowpostreply && !$_G['forum_thread']['archiveid']}-->
					<button id="post_reply" class="pn pnc" prompt="post_reply" onclick="window.location.href='forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]'"><strong>{lang reply}</strong></button>
				<!--{/if}-->
				<!--{/if}-->
				<!--{if $_G['forum']['ismoderator'] && $modopt && !$_G['forum_thread']['archiveid']}-->
				<button id="modopttmp" onclick="$('modopt').id = 'modopttmp';this.id = 'modopt';showMenu({'ctrlid':this.id})" class="pn"><em>{lang admin_modoptions}</em></button>
				<!--{/if}-->
			</td>
		</tr>
	</table>
</div>

{hook/viewthread_middle}

<!--{if $_G['setting']['fastpost'] && $allowpostreply && !$_G['forum_thread']['archiveid']}-->
	{subtemplate forum/viewthread_fastpost}
<!--{/if}-->

<!--{if $relatedthreadlist && $_G['setting']['qihoo']['relate']['position']}-->
	{template forum/viewthread_relatedthread}
<!--{/if}-->

{hook/viewthread_bottom}

<!--{if $_G['setting']['visitedforums']}-->
	<ul class="p_pop" id="visitedforums_menu" style="display: none">
	$_G['setting']['visitedforums']
	</ul>
<!--{/if}-->

<!--{if $_G['setting']['forumjump']}-->
	<div class="p_pop" id="fjump_menu" style="display: none">
	$forummenu
	</div>
<!--{/if}-->

<!--{if $_G['setting']['threadmaxpages'] > 1}-->
	<script type="text/javascript">document.onkeyup = function(e){keyPageScroll(e, {if $page > 1}1{else}0{/if}, {if $page < $_G['setting']['threadmaxpages'] && $page < $_G['page_next']}1{else}0{/if}, 'forum.php?mod=viewthread&tid=$_G[tid]{if $_G[gp_authorid]}&authorid=$_G[gp_authorid]{/if}', $page);}</script>
<!--{/if}-->
</div>

<div class="wp mtn">
	<!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]-->
</div>

{subtemplate common/footer}